<?php
$title = "登录";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title><?php print $title;?></title>
    <base href="<?php echo base_url();?>"/>
    <link href="style/base.css" rel="stylesheet" type="text/css" />
    <link href="style/common.css" rel="stylesheet" type="text/css" />
    <link href="style/zhuce.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>
    <script src="js/simplefoucs.js" type="text/javascript"></script>
    <script type="text/javascript" src="js/jquery.enplaceholder.js"></script>
    <script src="js/organictabs.jquery.js"></script>
    <script type="text/javascript" src="js/Common.js"></script>
    <script type="text/javascript" src="js/Validation.js"></script>
    <script type="text/javascript" language="javascript">
        // 文本框placeholder效果,给input加上类ph,使其支持placeholder效果
        $(function(){
            $('input.ph').placeholder({isUseSpan:true});
        })
    </script>
    <!--[if IE 6]>
    <script type="text/javascript" language="javascript" src="js/ie6/DD_belatedPNG_0.0.8a-min.js"></script>
    <script type="text/javascript" language="javascript">
        DD_belatedPNG.fix('.logo img,.footer_logo img');
    </script>
    <![endif]-->
    <script type="text/javascript">
        $(function(){
            $("#btnLogin").bind("click",login);
        });
        function login(){
            var isok=true;
            var loginName = $("#txtLoginName").val();
            var loginPwd = $("#txtLoginPwd").val();
            if(loginName==""){
                //SetError("txtLoginName","请输入账号");
                alert("请输入账号");
                return false;
            }
            if(loginPwd==""){
                alert("请输入密码");
                return false;
                //SetError("txtLoginPwd","请输入密码");
                //isok=false;
            }

            var params = {
                phone:loginName,
                pwd:loginPwd
            };

            var url="index.php/login/logon";
            $.ajax({
                type:"post",
                url:url,
                dataType:"json",
                data:params,
                async:false,
                success:function(data){
                    if(data.ReturnCode==1){
                        window.location='<?php echo base_url()?>index.php/login/index';
                    }else{
                        //SetError("txtLoginPwd",data.Msg);
                        alert(data.Msg);
                    }
                }
            });
        }
    </script>
</head>
<body>
<!-- head S-->
<?php include 'login_header.php';?>
<!-- head E-->

<!-- top S-->
<div class="top_zc">
    <div class="logo"><img src="images/logo_big.png" /></div>
    <div class="tit"><img src="images/txt_dzgn.png" /></div>
    <ul>
        <li class="icon_weixin">官方微信：hellomadou</li>
        <li class="icon_weibo">官方微博：hellomadou</li>
    </ul>
</div>
<!-- top E-->

<!-- 登录 S-->
<div class="login_zc">
    <div class="w1100">
        <div class="form">
            <form action="" method="">
                <input type="text" id="txtLoginName" name="txtLoginName" class="form_text ph" placeholder="手机号/邮箱" value="" />
                <input type="password" id="txtLoginPwd" name="txtLoginPwd" class="form_text ph" placeholder="登录密码" value="" />
                <input type="button" class="form_login" id="btnLogin" value="登 录" />
                <a href="index.php/login/registere" class="btn_regedit">注 册</a>
            </form>
        </div>
        <ul>
            <li class="btn_login_weibo"><a href="#" >微博账号登录</a></li>
            <li class="btn_login_qq"><a href="#">QQ账号登录</a></li>
            <li class="txt"><img src="images/txt_zcjks.png" /></li>
        </ul>
    </div>
</div>
<!-- 登录 E-->

<!-- banner大图 S-->
<div class="banner_zc">
    <div class="bannerbox">
    <div id="focus">
        <ul>
            <?php foreach($data as $item):?>
            <li><a href="<?php echo $item->url;?>" target="_blank">
                    <img src="<?php echo base_url().'uploads/'.$item->pic_path;?>" alt="" /></a></li>
            <?php endforeach;?>
        </ul>
    </div>
        </div>
</div>
<!-- banner大图 E-->

<!-- 底部 开始 -->
<?php include 'footer.php';?>
<!-- 底部 结束 -->
</body>
</html>
